Skip to content

Conversation

chenglou
Copy link
Member

@chenglou chenglou commented Feb 22, 2018

Addresses a first wave of beta feedback.

This puts the most important stuff in prominent position. Before:

{ left: { left: null, key: 1, right: null, h: 1 },
  key: 2,
  right:
   { left: null,
     key: 3,
     right: { left: null, key: 5, right: null, h: 1 },
     h: 2 },
  h: 3 }

After:

{ value: 2,
  height: 3,
  left: { value: 1, height: 1, left: null, right: null },
  right:
   { value: 3,
     height: 2,
     left: null,
     right: { value: 5, height: 1, left: null, right: null } } }

Friendlier in browser consoles too. Explicitly name "h" to "height" for extra education.

@chenglou
Copy link
Member Author

cc @keirah =)

@bobzhang
Copy link
Member

bobzhang commented Feb 23, 2018

should not height be least important? in general, the second commit would be much easier to review and merged, it would be good to split PRs into small commits

chenglou added a commit to chenglou/rescript-compiler that referenced this pull request Feb 23, 2018
@chenglou
Copy link
Member Author

chenglou commented Feb 23, 2018

K, I've pulled the second part out to #2539.

Height is indeed less important, but having left and right at the end formats better in node repl and chrome console, so I sandwiched it in the middle. Top and bottom are important. Plus, I don't think we should mingle not being important with being cryptic (the other names are well chosen).

@chenglou
Copy link
Member Author

chenglou commented Mar 3, 2018

Rebased.

@chenglou
Copy link
Member Author

chenglou commented Mar 4, 2018

@bobzhang the other PR is accepted, so this one's now just about the height and field position change. Before:
screenshot 2018-03-03 16 34 26
After:
screenshot 2018-03-03 16 34 42

Note that in either vertical or horizontal reading, the value and subtree are now easier to find.

This puts the most important stuff in prominent position. Before:

```js
{ left: { left: null, key: 1, right: null, h: 1 },
  key: 2,
  right:
   { left: null,
     key: 3,
     right: { left: null, key: 5, right: null, h: 1 },
     h: 2 },
  h: 3 }
```

After:

```js
{ value: 2,
  height: 3,
  left: { value: 1, height: 1, left: null, right: null },
  right:
   { value: 3,
     height: 2,
     left: null,
     right: { value: 5, height: 1, left: null, right: null } } }
```

Friendlier in browser consoles too. Explicitly name "h" to "height" for extra education.
@chenglou
Copy link
Member Author

chenglou commented Mar 5, 2018

Rebased again

@bobzhang
Copy link
Member

bobzhang commented Mar 5, 2018

see my comments above, should height be moved to the last position(maybe called h is fine in that case?)

@rickyvetter
Copy link
Contributor

I definitely agree that left/right should be grouped together (not split by key/value). Less opinionated about whether it happens at the top or the bottom. I think @chenglou's argument for the end is similar to the t-first argument that the larger, potentially messier, values should be toward the bottom to make the entire shape easier to read. Ranking by importance is interesting, but much more subjective. Is key/value more or less important than left/right?

@chenglou
Copy link
Member Author

chenglou commented Mar 5, 2018

@bobzhang height should not be at the last position; in the screenshot it's hard to see where value, left and right are when height is not stuffed in the middle

@chenglou
Copy link
Member Author

chenglou commented Mar 5, 2018

Left/right at the top means you get a chunk of trailing closing heights when opening deep values in the inspector

@bobzhang
Copy link
Member

bobzhang commented Mar 5, 2018

I have no strong opinions since this would not affect user side any way, feel free to merge it after CI

@chenglou
Copy link
Member Author

chenglou commented Mar 5, 2018

Cool! Thanks

@chenglou chenglou merged commit 0c5f79c into rescript-lang:master Mar 5, 2018
@chenglou chenglou deleted the words branch March 5, 2018 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants